package com.fenghongzhang.day012;

import android.os.Bundle;
import android.widget.HorizontalScrollView;
import android.widget.SeekBar;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class Main3Activity extends AppCompatActivity {
    private SeekBar seek;
    private TextView text;
    private HorizontalScrollView sv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);


        sv = (HorizontalScrollView) findViewById(R.id.sv);
        seek = (SeekBar) findViewById(R.id.seek);
        text = (TextView) findViewById(R.id.text);


        seek.setMax(1000);

        seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                sv.setPivotX(progress);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });

        sv.setPivotX(200);





    }
}
